import {createApp} from 'vue'
import {createPinia} from 'pinia'
import '@style/index.css'
import 'element-plus/dist/index.css'
import 'element-plus/theme-chalk/dark/css-vars.css'
// @ts-ignore
import 'virtual:svg-icons-register'
import App from './App.vue'
import ElementPlus from 'element-plus'
import * as Icons from '@element-plus/icons-vue'
import router from "@/router";
import '@/router/guard'
import {installDirect} from "@direct";
import {installComponent} from "@component";

const app = createApp(App)

// 注册事件对象
app.use(createPinia())

// 引入EL
app.use(ElementPlus)
Object.keys(Icons).forEach(key => {
    app.component(key, Icons[key as keyof typeof Icons])
})

// 注册-指令
installDirect(app)

// 注册-组件
installComponent(app)

// 关闭警告日志
app.config.warnHandler = () => null;

//
app.use(router)

app.mount('#app')
